package com.gadgets.busi.bm08.common.dto;

import com.gadgets.busi.bm08.common.Bm08Constant;
import com.gadgets.busi.bm08.pojo.HdsQuestion;

/**
 * 功能说明：题型维度分值设置
 * 软件版权：恒生电子股份有限公司
 *
 * @author xiujunqing
 * @version V202101.00.000
 * @data 2022-05-24
 * 修改记录：  修改日期          修改人员    修改说明
 * 2022-05-24  xiujunqing   创建文件
 */
public class DimensionTypeDTO {

	/**
	 * 选择题分值
	 */
	private int signle;
	/**
	 * 多选题分值
	 */
	private int multi;
	/**
	 * 填空题分值
	 */
	private int blank;
	/**
	 * 简答题分值
	 */
	private int answer;
	/**
	 * 判断题分值
	 */
	private int judge;

	public int getSignle() {
		return signle;
	}

	public void setSignle(int signle) {
		this.signle = signle;
	}

	public int getMulti() {
		return multi;
	}

	public void setMulti(int multi) {
		this.multi = multi;
	}

	public int getBlank() {
		return blank;
	}

	public void setBlank(int blank) {
		this.blank = blank;
	}

	public int getAnswer() {
		return answer;
	}

	public void setAnswer(int answer) {
		this.answer = answer;
	}

	public int getJudge() {
		return judge;
	}

	public void setJudge(int judge) {
		this.judge = judge;
	}

	public int getTotalScore() {
		return signle + multi + blank + answer + judge;
	}

	public void calculatePoint(HdsQuestion hds, int direction) {
		int point = hds.getPoint() * direction;
		if (Bm08Constant.QUEST_TYPE.SINGLE_SELECT.equals(hds.getType())) {
			//单选
			this.signle = this.signle + point;
		}else if (Bm08Constant.QUEST_TYPE.MULTI_SELECT.equals(hds.getType())) {
			//多选
			this.multi = this.multi + point;
		}else if (Bm08Constant.QUEST_TYPE.COME_IN_BLANK.equals(hds.getType())) {
			//填空
			this.blank = this.blank + point;
		}else if (Bm08Constant.QUEST_TYPE.FIX_QUESTION.equals(hds.getType())) {
			//简答
			this.answer = this.answer + point;
		}else if (Bm08Constant.QUEST_TYPE.JUDGE_QUESTION.equals(hds.getType())) {
			//判断
			this.judge = this.judge + point;
		}
	}

	public String toStringPoint() {
		String str = "";
		if (this.signle > 0) {
			str = str + "单选:"+this.signle+"分 ";
		}
		if (this.multi > 0) {
			str = str + "多选:"+this.multi+"分 ";
		}
		if (this.blank > 0) {
			str = str + "填空:"+this.blank+"分 ";
		}
		if (this.judge > 0) {
			str = str + "判断:"+this.judge+"分 ";
		}
		if (this.answer > 0) {
			str = str + "简答:"+this.answer+"分 ";
		}
		return str;
	}
}
